﻿<UserControl x:Class="YouTubePlaylist.Views.TrackOptionsCtrl"
    xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation" 
    xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml" 
    xmlns:Controls="clr-namespace:System.Windows.Controls;assembly=System.Windows.Controls.Toolkit"
    xmlns:SharedLibrary="clr-namespace:Radovici.SharedLibrary;assembly=RadoviciSharedLibrary" 
    xmlns:Hacks="clr-namespace:Radovici.Ctrls.Hacks;assembly=RadoviciCtrls">
    <UserControl.Resources>
        <SharedLibrary:BooleanToVisibilityConverter x:Key="ToVisibilityConverter"/>
    </UserControl.Resources>
    <Border CornerRadius="10" BorderBrush="Black" BorderThickness="2" Padding="4" Background="LightGoldenrodYellow"
                    Visibility="{Binding IsActive, Converter={StaticResource ToVisibilityConverter}}" MouseMove="OnOptionsMouseMove">
        <Grid>
            <Grid.RowDefinitions>
                <RowDefinition/>
                <RowDefinition/>
                <RowDefinition/>
            </Grid.RowDefinitions>
            <StackPanel Grid.Row="0" Orientation="Horizontal" Margin="0,2,0,2">
                <TextBlock Text="Options for selected track:" Margin="0,0,2,0" VerticalAlignment="Center"/>
                <TextBlock Text="{Binding PlaylistModel.SelectedTrack.Name}" Margin="2,0,0,0" VerticalAlignment="Center"/>
            </StackPanel>
            <Controls:WrapPanel Grid.Row="1" Orientation="Horizontal" Margin="0,2,0,2">
                <Button Click="OnMail" Tag="mail" Margin="0,4,4,0" MouseEnter="OnOptionMouseEnter" MouseLeave="OnOptionMouseLeave">
                    <StackPanel Orientation="Horizontal">
                        <Image Source="Resources/16/mail_attachment.png" Margin="2,0,2,0" VerticalAlignment="Center"/>
                        <TextBlock Text="Email" Margin="2,0,2,0" VerticalAlignment="Center"/>
                    </StackPanel>
                </Button>
                <Button Click="OnLink" Tag="link" Margin="0,4,4,0" MouseEnter="OnOptionMouseEnter" MouseLeave="OnOptionMouseLeave">
                    <StackPanel Orientation="Horizontal">
                        <Image Source="Resources/16/paperclip.png" Margin="2,0,2,0" VerticalAlignment="Center"/>
                        <TextBlock Text="Copy to Clipboard" Margin="2,0,2,0" VerticalAlignment="Center"/>
                    </StackPanel>
                </Button>
                <Button Click="onDeleteTrack" Tag="delete" Margin="0,4,4,0" MouseEnter="OnOptionMouseEnter" MouseLeave="OnOptionMouseLeave">
                    <StackPanel Orientation="Horizontal">
                        <Image Source="Resources/16/cd_delete.png" Margin="2,0,2,0" VerticalAlignment="Center"/>
                        <TextBlock Text="Delete" Margin="2,0,2,0" VerticalAlignment="Center"/>
                    </StackPanel>
                </Button>
                <Button Click="onRefreshTrack" Tag="refresh" Margin="0,4,4,0" MouseEnter="OnOptionMouseEnter" MouseLeave="OnOptionMouseLeave">
                    <StackPanel Orientation="Horizontal">
                        <Image Source="Resources/16/recycle.png" Margin="2,0,2,0" VerticalAlignment="Center"/>
                        <TextBlock Text="Refresh Videos" Margin="2,0,2,0" VerticalAlignment="Center"/>
                        <Hacks:ComboBoxPlus x:Name="SelectedTrackUrls" SelectedItem="{Binding PlaylistModel.SelectedTrack.SelectedUrl}" ItemsSource="{Binding PlaylistModel.SelectedTrack.Urls}"
                                          Margin="2,0,2,0" Loaded="OnSelectedTrackUrlsLoaded" Tag="{Binding}"/>
                    </StackPanel>
                </Button>
            </Controls:WrapPanel>
            <TextBlock Grid.Row="2" Margin="0,2,0,2" TextWrapping="Wrap" Text="{Binding PlaylistModel.SelectedOptionHelp}"/>
        </Grid>
    </Border>
</UserControl>
